import request from '/@/utils/request';
import { AxiosResponse } from 'axios';

export interface IRecognizeIdentityCardRequest {
  ImageId: string; // 图片ID
  CardType: string; // 证件类型 front（正面）、back（反面），默认为front
}

interface ISiteconfigApi {
  getCurrentSiteConfig: () => Promise<AxiosResponse<any>>;
  recognizeIdentityCard: (data: IRecognizeIdentityCardRequest) => Promise<AxiosResponse<any>>;
}

function siteconfigApi(): ISiteconfigApi {
  return {
    getCurrentSiteConfig: () => {
      return request({
        url: '/api/syssiteconfig/getsiteconfig',
        method: 'get',
      });
    },
    recognizeIdentityCard: (data: IRecognizeIdentityCardRequest) => {
      return request({
        url: '/api/_account/RecognizeIdentityCard',
        method: 'post',
        data,
      });
    },
  }
}

export { siteconfigApi }